package br.ufrj.dcc.smarthotel.listeners;

import java.util.Hashtable;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import br.ufrj.dcc.smarthotel.activities.RequestDetailActivity;
import br.ufrj.dcc.smarthotel.activities.RequestedServicesActivity;
import br.ufrj.dcc.smarthotel.entities.Request;

public class RequestedServicesClickListener implements OnItemClickListener {
	private RequestedServicesActivity activity;
	
	public RequestedServicesClickListener (RequestedServicesActivity activity) {
		this.activity = activity;
	}
	
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		Request clickedRequest = this.activity.getRequestsList().get(position);
		
		Hashtable<String, String> params = new Hashtable<String, String>();
		
		params.put("clickedRequestId", String.valueOf(clickedRequest.getRequestId()));
		
		this.activity.startActivity(RequestDetailActivity.class, params);
	}

}
